package com.koron.order.linedefect.base.bean.convertor;

import com.koron.order.common.bean.dto.OrderDispatchDto;
import com.koron.order.common.bean.po.OrderExecute;
import com.koron.order.common.bean.vo.OrderDispatchVo;
import com.koron.order.linedefect.base.bean.dto.DefectDTO;
import com.koron.order.linedefect.base.bean.po.DefectBean;
import com.koron.order.linedefect.base.bean.po.DefectExecute;
import com.koron.order.linedefect.base.bean.vo.DefectDetailVo;
import com.koron.order.linedefect.base.bean.vo.DefectExecuteVO;
import com.koron.order.linedefect.base.bean.vo.DefectVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface LineDefectConvertor {

    DefectBean dtoToBean(DefectDTO vo);

    @Mappings(
            {
                    @Mapping(target = "id", source = "defectExecuteId"),
                    @Mapping(target = "executeId", source = "orderExecuteId")
            }
    )
    DefectExecute voToDefectExecuteBean(DefectExecuteVO vo);

    @Mappings(
            {
                    @Mapping(target = "id", source = "orderExecuteId")
            }
    )
    OrderExecute voToOrderExecuteBean(DefectExecuteVO vo);

    OrderDispatchDto voToDto(OrderDispatchVo orderDispatchVo_pre);

    DefectDetailVo beanToDetailVo(DefectBean defectBean);

    DefectDetailVo voToDetailVo(DefectVO defectVO);
}
